package za.co.yellowfire.solarflare;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @author Mark P Ashworth
 * @version 0.1
 */
public interface SearchManager extends Serializable {
    /**
     * A searchable object was added
     * @param object The object to add to the index
     */
    void onSearchableAdded(Object object);

    /**
     * Observes when searchable objects are added.
     * @param objects The list of objects to add to the index
     */
    void onSearchablesAdded(Collection<?> objects);

    /**
     * A searchable object was removed
     * @param object The object to remove from the index
     */
    void onSearchableRemoved(Object object);
    
    /**
     * Searches for the value in the seatch engine
     * @param query The search query
     * @return The list of objects found in the index
     */
    SearchResult search(SearchQuery query);
}
